import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutterhello/controller/Controller.dart';
import 'package:flutterhello/pages/one/widgets/activiteCard.dart';
import 'package:get/get.dart';

class MyCreateActPage extends StatelessWidget {
  final controller = Get.put(Controller());
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: PreferredSize(
        child: AppBar(
          title: Text('我发起的活动'),
          centerTitle: true,
        ),
        preferredSize: Size.fromHeight(50),
      ),
      body: EasyRefresh.custom(
        slivers: <Widget>[
          SliverToBoxAdapter(
            child: SizedBox(
              height: 20,
            ),
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
              (BuildContext context, int index) {
                return ActiviteCard(info: controller.myCreateAct[index]);
              },
              childCount: controller.myCreateAct.length,
            ),
          )
        ],
      ),
    );
  }
}
